home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / irsim-ca.2 / irsim-ca / irsim-cap-9.2 / src / ana11 / defaults.c < prev    next >
C/C++ Source or Header  |  1993-01-15  |  2KB  |  92 lines

  1. /*
  2.  *     ********************************************************************* 
  3.  *     * Copyright (C) 1988, 1990 Stanford University.                     * 
  4.  *     * Permission to use, copy, modify, and distribute this              * 
  5.  *     * software and its documentation for any purpose and without        * 
  6.  *     * fee is hereby granted, provided that the above copyright          * 
  7.  *     * notice appear in all copies.  Stanford University                 * 
  8.  *     * makes no representations about the suitability of this            * 
  9.  *     * software for any purpose.  It is provided "as is" without         * 
  10.  *     * express or implied warranty.  Export of this software outside     * 
  11.  *     * of the United States of America may require an export license.    * 
  12.  *     *********************************************************************
  13.  */
  14.  
  15. #include "ana.h"
  16. #include "defs.h"
  17. #include "ana_glob.h"
  18.  
  19. public
  20. #define    DEFL_GEOM    0
  21. public
  22. #define    DEFL_BG        1
  23. public
  24. #define    DEFL_FG        2
  25. public
  26. #define    DEFL_RV        3
  27. public
  28. #define    DEFL_HIGL    4
  29. public
  30. #define    DEFL_TRCOLOR    5
  31. public
  32. #define    DEFL_BANN_BG    6
  33. public
  34. #define    DEFL_BANN_FG    7
  35. public
  36. #define    DEFL_BDRCOLOR    8
  37. public
  38. #define    DEFL_FONT    9
  39. public
  40. #define    DEFL_BDRWIDTH    10
  41.  
  42.  
  43. typedef struct
  44.   {
  45.     char  *name;
  46.     char  *defl;
  47.   } Assoc;
  48.  
  49.  
  50. private    Assoc assoc[] =
  51.   {
  52.     { "geometry",    "=1000x300+0+0" },
  53.     { "background",    "black" },
  54.     { "foreground",    "white" },
  55.     { "reverseVideo",    "off" },
  56.     { "highlight",    "red" },
  57.     { "traceColor",    "white" },
  58.     { "bannerBg",    "white" },
  59.     { "bannerFg",    "black" },
  60.     { "borderColor",    "black" },
  61.     { "font",        "6x13" },
  62.     { "borderWidth",    "2" },
  63.   };
  64.  
  65.  
  66. private    char  *irsim = "irsim";
  67.  
  68. public char *GetXDefault( key )
  69.   int  key;
  70.   {
  71.     char         *val;
  72.  
  73.     val = XGetDefault( display, irsim, assoc[ key ].name );
  74.     return( (val != NULL) ? val : assoc[ key ].defl );
  75.   }
  76.  
  77.  
  78. public int IsDefault( key, val )
  79.   int   key;
  80.   char  *val;
  81.   {
  82.     if( assoc[ key ].defl == val )
  83.     return( TRUE );
  84.     return( (strcmp( assoc[ key ].defl, val ) == 0) ? TRUE : FALSE );
  85.   }
  86.  
  87.  
  88. public char *ProgDefault( key )
  89.   {
  90.     return( assoc[ key ].defl );
  91.   }
  92.